import { api, apiMock, actionTypes } from '@constant';

export const getAPI = (name, type = 'api') => {
  if (type === 'action') return actionTypes[name];

  const targetAPI = type === 'mock' ? apiMock : api;
  return `${targetAPI.BASE_URL}/${targetAPI[name]}`;
};
